package com.linkage.lcims.base.dao.cdma.impl;

import java.util.Map;

import com.linkage.lcims.base.dao.cdma.interfaces.UserBindImsiDAO;
import com.linkage.lcims.base.po.cdma.CUserBindImsi;
import com.linkage.lcims.base.dao.HibernateBaseDAOImpl;
import com.linkage.util.exception.DAOException;

public class UserBindImsiDAOImpl extends HibernateBaseDAOImpl implements
		UserBindImsiDAO {

	// private static final String tablePrefix="C_USER_BIND_IMSI";

	public void deleteUserBindImsi(CUserBindImsi userBindImsi)
			throws DAOException {
		try {
			this.delete(userBindImsi);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public CUserBindImsi getUserBindImsi(CUserBindImsi userBindImsi)
			throws DAOException {
		try {
			return (CUserBindImsi) this.getByID(CUserBindImsi.class,
					userBindImsi.getComp_id());
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public void saveUserBindImsi(CUserBindImsi userBindImsi)
			throws DAOException {
		try {
			this.save(userBindImsi);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public void updateFileds(Map<String, ?> keys, Map<String, ?> fields)
			throws DAOException {
		try {
			this.updateField("com.linkage.lcims.base.po.cdma.CUserBindImsi",
					"com.linkage.lcims.base.po.cdma.CUserBindImsiPK", keys,
					fields);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

	public void updateUserBindImsi(CUserBindImsi userBindImsi)
			throws DAOException {
		try {
			this.merge(userBindImsi);
		} catch (Exception e) {
			throw new DAOException(e);
		}
	}

}
